Copyright: This software is in the public domain


Table of Contents
Speak Freely for Windows

by John Walker (kelvin@fourmilab.ch)

WWW Home page: http://www.fourmilab.ch/

Speak Freely is a Windows application that allows you to talk (actually send voice, not typed characters) over a network.  If your network connection isn't fast enough to support real-time voice data, three forms of compression may allow you, assuming your computer is fast enough, to converse nonetheless.  To enable secure communications, encryption with DES, IDEA, and/or a key file is available.  If PGP is installed on the user's machine, it can be invoked automatically to exchange IDEA session keys for a given conversation.  Speak Freely for Windows is compatible with Speak Freely for Unix, and users of the two programs can intercommunicate.  Users can find one another by communicating with a "Look Who's Listening" phonebook server.  You can designate a bitmap file to be sent to users who connect so they can see who they're talking to.

Introduction

Hardware and software requirements

Connections

Creating a new connection

Setting connection options

Closing a connection

Saving a connection in a file

Opening a connection file

Configuring modem connections

Communicating

Receiving audio

Sending live audio

Sending sound files

Ringing remote users

Multicasting to a group

Broadcasting to multiple sites

Viewing extended status

The answering machine

Show your face

Phonebook: Look Who's Listening

Publishing your directory entry

Finding on-line users

Compression modes

Encryption

Why encryption?

Varieties of encryption

PGP key exchange

DES (Data Encryption Standard)

IDEA (International Data Encryption Algorithm)

Key file

Generating and exchanging keys

Legal issues

Patent issues

Command line arguments

Problems, problems

Regular pauses in audio output

Random pauses in audio output

Modem connections don't work

Compression slows down transmission

Debugging: Viewing extended status

Workarounds for driver bugs

Hardware issues

Viewing hardware configuration

8 or 16 bit sampling?

Half- or full-duplex?

Bugs, features, and frequently asked questions

References

Credits

Bookshelf

Speak Freely for Unix

Development log

About the author


Introduction

Speak Freely is a Microsoft Windows application that allows you, with appropriate hardware and software, to send and receive audio, in real time, over a computer network.  If you're connected to the Internet by a sufficiently high-speed link, you can converse with anybody else similarly connected anywhere on Earth without paying long-distance phone charges.  Users can find one another, even if they have dial-up connections to the Internet, by publishing and searching directory entries on a Look Who's Listening server. You can designate a bitmap file to be sent to users who connect so they can see who they're talking to.

Speak Freely not only because you aren't running up your phone bill, but also knowing your conversation is secure from eavesdroppers.  Speak Freely provides three different kinds of encryption, including the same highly-secure IDEA algorithm PGP uses to encrypt message bodies.  By using PGP to automatically exchange session keys, you can Speak Freely to total strangers, over public networks, with greater security than most readily available telephone scramblers provide.

Speak Freely for Windows is 100% compatible Speak Freely for Unix, currently available for Sun and Silicon Graphics workstations.  Windows users can converse, over the Internet, with users of those Unix machines.

Multicasting is implemented, allowing those whose networks support the facility to create multi-party discussion groups to which users can subscribe and drop at will.  For those without access to Multicasting, a rudimentary Broadcast capability allows transmission of an audio feed to multiple hosts on a fast local network.

Speak Freely was designed to permit dial-up modem connections as well as conversations over data networks and thus serve as a secure personal phone scrambler.  Unfortunately, even though modems with adequate speed are available and affordable, serial port hardware and software drivers in most Windows machines simply cannot operate at the speed required.  Preliminary code to support modem connections is included in Speak Freely, but unless you have special serial port hardware and Windows drivers that take advantage of it, modem connections are nothing but an exercise in frustration.


Hardware and software requirements

In order to use Speak Freely, you need a personal computer with the following hardware and software:

Microsoft Windows 3.1 or above, in 386 Enhanced Mode

Sound input/output card with Windows Multimedia driver

Microphone and speaker(s) compatible with sound card

Network interface with TCP/IP WINSOCK driver

Sending real-time audio over a data network is demanding on every component in the chain, and the performance required of your computer and network interact in complicated ways.  For example, if you're communicating exclusively with other people over a high-speed local network and you aren't worried about eavesdropping, you don't need to enable either compression or encryption, both of which require a great deal of computation.  For such an application a 386 machine is perfectly adequate.  If your network link is slower, you'll have to compress the sound before it's transmitted.  The most effective form of compression provided by Speak Freely, that used by GSM digital cellular telephones, reduces the data bandwidth requirement by almost a factor of five but is so computationally intense it can be done in real time only on a very fast 486 or Pentium machine.  Encryption also takes time; the three methods available vary in the computation required.  Compression reduces encryption overhead since there's less to encrypt.

Whether Speak Freely will work effectively for you depends upon your CPU speed, network bandwidth, load on the network, and the compression and encryption modes you select in a complicated and subtle manner.  The best way to find out is to try it; if it works, great; if it doesn't, try again when you next upgrade your computer or network connection.


Opening a new connection
Creating a new connection

To open a new connection, use the Connection/New... menu item.  The new connection dialogue box will appear.

To initiate a network connection, enter the name of the host you wish to connect to, either as an Internet host name (for example, stinky.dwarves.org) or a numeric Internet address (IP address) such as 123.45.67.89.

To connect to another machine via modem, check the "Connect via modem" box.  The text field label changes to "Dial string".  Enter the command string to instruct your modem to dial the remote machine (for example ATDT0033152729371).  Before you can open a modem connection, you must first enable modem connections and configure your modem using the Options/Modem dialogue.  Due to shortcomings of Windows serial port drivers on most PCs, modem connections are disappointing at the present time.

When you press OK, an attempt will be made to establish the connection.  Any errors which occur in the process will be reported in message boxes.  If the connection is successfully established, a new connection window appears.  If you select a host to which a connection is already established, its window will be activated.  Once the connection is open, you can send live audio or sound files to the other party.

If audio is received from a host to which you don't have an active connection, a temporary connection is created.  Unless you send audio or a sound file using that connection, it will be automatically closed after 30 seconds of inactivity.  If you check the Options/Look Who's Talking menu item, if a new connection is established from a remote host while Speak Freely is minimised to an icon, it will pop open automatically so you can see who's just begun to talk to you.

If the person you connect to has provided an image of his or her face, it will appear in the connection window shortly after you receive the first sound from that user.

A new connection is created with default properties: no encryption or debugging selected.  Use the Options/Connection menu item to select the modes you wish for the new connection.


Setting connection options

When a connection is active, you can use the Options/Connection menu item to display the Connection Properties dialogue, which allows you to specify encryption keys and debug modes for the connection.  All of these modes are saved when you save a connection in a file.

Encryption keys

To encrypt audio you send and decrypt audio you receive with DES and/or IDEA, enter the key in the appropriate box; each key can be as long as 255 characters, perhaps a key phrase you've exchanged with the other party via PGP, or a "session key" generated automatically by Options/Create Key.  To encrypt sound with a key given in a binary file, enter the full pathname of the file or use the Browse button to display an open file dialogue to select the file.

If PGP is installed on your machine, you can enter the names of one or more users on your PGP public keyring in the "PGP user name(s)" box.  When you close the Connection Option dialogue, a random session key will be generated, PGP invoked to encrypt it with the public keys of the named individuals, and the encrypted session key transmitted.  See "PGP Key Exchange" for additional information.  The ability to encrypt a session key with more than one user's public key allows you to transmit securely to multiple subscribers to a multicast.

When you save a connection in a file, encryption keys are not, by default, written to the file; you must therefore re-enter them every time you reestablish the connection.  If you check the "Save keys in connection file" box, they will be saved and restored automatically.  This is very convenient, but consider that anybody who has access to files on your computer can obtain keys that permit them to listen in on your private conversations.  It's up to you, based on physical situation of your computer and personal trade-off of convenience versus security, to decide.

Debugging options

Checking the "Debug" box causes additional information to be displayed in the connection window when you send and receive sound.  When you send sound from a connection with debugging enabled, debug information appears in the connection window on the receiving end as well.  This is generally useful only to developers modifying the Speak Freely program.

Checking "Loop-back" causes the machine at the other end of the connection to immediately retransmit every packet of sound it receives back to your computer.  You can use this to evaluate network performance and select an appropriate compression mode.  In order to use loop-back effectively, your audio input/output hardware needs to be full-duplex--able to send and receive sound simultaneously.  Many low-cost PC sound cards can't do this--whenever you're sending sound, any sound you receive is lost; if you have such hardware, there's no way to play the looped-back packets as they arrive.


Closing a connection

To close a connection, use the Connection/Close menu item.  A connection can be closed at any time, even while you're sending or receiving sound (the transmission will be rudely interrupted).  If additional sound subsequently arrives from the remote host, a new temporary connection will be automatically opened.

Closing a connection discards any changes you've made to the connection options.  If you'd like to later reestablish the connection with the same options, save the connection to a file before closing it.


Saving a connection in a file

The Connection/Save and Connection/Save As... menu items create an .SFX file in which all the options of the connection are saved.  You can later reestablish the connection with the same properties by loading the .SFX file with the Connection/Open... menu item.

The first time you save a new connection, use Save As... to specify the name of the .SFX file.  Subsequently, you can use Save to write changes to the connection options to the file.


Opening a connection file

The Connection/Open... menu item opens a connection using the destination and connection options given in an .SFX file previously created by Connection/Save or Connection/Save As....

If a connection to the host named by the .SFX file is already open, its options are set to those found in the file.

You can also open a connection by dragging an .SFX file from the File Manager and dropping it in an open area of Speak Freely's window.  If you make an association between the .SFX file type and Speak Freely, you can launch Speak Freely by double clicking an .SFX file in the File Manager.

If you'd like Speak Freely to start with one or more connections already open, you can specify their .SFX files on the Speak Freely command line.


Configuring for modem connections

Before you can create a modem connection with the Connection/New... dialogue, you must configure the modem and enable its use by Speak Freely.  The Options/Modem menu item displays the Modem Settings dialogue box.  Select the serial port to which your modem is attached, the baud rate at which you will transfer data, and the initialisation string, if any, to be sent to place the modem in the proper modes, including auto-answer if you intend to receive calls from others.  Finally, check the "Enable modem connections" box to grant Speak Freely access to the modem.

Due to shortcomings of Windows serial port drivers on most PCs, modem connections are disappointing at the present time.


Receiving sound

As sound packets arrive, they're immediately sent to the audio output device.  If a packet arrives from a host with which you haven't opened a connection, a new temporary connection to that host is automatically opened.  If you respond to the host by either sending live audio or a sound file, the connection becomes permanent.  Otherwise, a temporary connection is automatically closed if no sound is received from that host for 30 seconds.

If sound arrives simultaneously from more than one host, the packets are interleaved.  This makes it difficult to understand, but it does permit interrupting a long winded speaker in a conference call.


Sending live audio

To send live audio to a connected host, move the mouse into its open connection window.  When you do so, the mouse cursor changes into a button showing a telephone receiver.  When you press and hold the left mouse button, the cursor changes to an ear and the legend "Transmitting" appears in the connection window, indicating you're now sending live audio from your audio input port to that host.

If you double click the left mouse button, live audio output is sent continuously until you next single click in the connection window.  You can thus double click in multiple connection windows transmit simultaneously to a number of hosts (assuming your network is fast enough to handle the additional traffic).  If your sound hardware is full-duplex, this lets you make "conference calls" where several people make connections to one another and take turns speaking.  If your network supports it, multicasting may provide a more efficient way to conduct conference calls than directly transmitting to multiple hosts.

You can also use the space bar to toggle transmission of live audio; if you don't have a mouse, use Ctrl+Tab to activate the desired connection window, then press the space bar to begin transmitting.  When you're done, a second press of the space bar ends the transmission.


Sending sound files

To send a prerecorded sound file to the active connection window, use the Connection/Send Sound File... menu item or drag the sound file icon from the File Manager and drop it in any connection window or icon, whether active or not.

Sound files can be in Windows .WAV format, monaural or stereophonic, 8 or 16 bits per sample, at 8000, 11025, 22050, or 44100 samples per second (if you're making a file expressly to be sent by Speak Freely, for best sound quality and efficiency select 8000 16 bit monaural samples per second).  For compatibility with Unix and the World-Wide Web, you can also send files in Sun Audio File or raw Sun Audio formats (.AU files).  Such files are assumed to be recorded at 8000 8 bit monaural samples per second, using mu-law encoding.


Ringing a remote user

Sometimes you're trying to establish a connection with a remote user who's running Speak Freely, but who's accidentally turned the volume down to zero or, as happens on Sun workstations, diverted output from the speaker to the headphones and forgotten to return it to the speaker when taking off the 'phones.  Selecting the Connection/Ring menu item sends the "Ring sound file", the first packet of which will contain a flag which causes the receiving machine to try to get the user's attention.  Speak Freely, upon receiving such a packet, sets the output volume to the maximum value; a Sun workstation diverts audio output to the speaker and sets output volume to the default level.

The Ring File can be any file you could send with Connection/Send Sound File....  The first time you use Ring, a dialogue appears which invites you to designate a sound file as the Ring file; subsequent Ring requests use that file without prompting you.  You can change the Ring file at any time with the Options/Ring File Name... menu item.

It is impolite to ring a user without first seeing if a regular hail elicits a response.


Multicasting to a group

Some implementations of Windows Sockets support "IP Multicasting", a facility which allows the creation of conference groups which individual hosts can join and leave at will.  A multicast conference is far more efficient than sending duplicate messages to all recipients, as actual replication of packets is done as close as possible to the actual recipient.  If your network does not support Multicasting, you may be able to use the Speak Freely's Broadcast facility to transmit audio to multiple destinations.

If your Windows network software implements IP Multicasting, you can use the Connection/Multicast Groups dialogue to join and drop multicast conferences.  To join a conference, enter its name or numeric IP address in the "Add group" edit box and press the eponymous button.  If the address is a valid multicast address, it will be added to the "Group memberships" list at the left.  To leave a conference, select its item in the Group memberships box and click the "Drop Group" button.  If you've joined  a multicast group and you send sound to it, the sound is normally sent back to your own machine.  If you don't like this, or if it doesn't make sense because your sound hardware is half-duplex, uncheck the "Loop back multicasts" button to disable this action.  Some Windows Sockets implementations don't allow you control over this behaviour; if that's the case, the Loop back button will be disabled.

You transmit to a multicast group as you would to any other host; create a new connection or open a connection file to the name or numeric IP address of the group. You can specify the extent of distribution of your multicast by entering a number in the "Multicast scope" field of the Options/Connection dialogue.  The following are guidelines for multicast scope values:

Distribution	Multicast scope

Restricted to the same host	0

Restricted to the same subnet	1

Restricted to the same site	32

Restricted to the same region	64

Restricted to the same continent	128

Unrestricted	255

The distribution scopes given above should be taken cum grano salis.  Their meaning depends entirely upon the implementation of the various intermediate links in the multicast network.


Broadcasting to multiple sites

The most efficient way to transmit audio to a group of sites is "IP Multicasting", which allows the creation of conference groups that individual hosts can join and leave at will.  A multicast conference is far more efficient than sending duplicate messages to all recipients.  Unfortunately, many networks do not support, or have not enabled Multicasting, and often setting up Multicast groups requires the involvement of a site's system administrator, making it difficult to use for informal, ad hoc groups.

Speak Freely's Broadcast facility provides an alternative which requires no special network configuration.  Without the benefit of Multicasting is it forced, however, to send duplicate packets to each recipient, which usually works only on fast local networks.  Since many educational institutions and enterprises have such networks, broadcasting can be an effective way to transmit classes, seminars, and meetings to multiple destinations within the organisation.

Broadcasting is activated by checking the Connection/Broadcast menu item.  Audio input is sent to all currently-open connections and the title bar displays a legend indicating a broadcast is in progress.  When a broadcast is underway, other hosts can "subscribe" to the broadcast simply by making a connection to the broadcasting host and sending a short (say, one second) burst of sound to it.  (The sound is discarded by the broadcasting host and will not affect the broadcast).  This opens a connection to the new host, which will then begin to receive the broadcast.  A host can unsubscribe from the broadcast by sending another short burst of sound.  To prevent rapid toggling between subscribed and unsubscribed state, at least 10 seconds must elapse between subscribe and unsubscribe requests, and transmission to a host may continue for up to 10 seconds after it sends an unsubscribe request.

Toggling broadcasting off immediately ceases the transmission.  Connections established during the broadcast will time out according to the normal rules unless additional sound is received from them or sound is explicitly sent to their connection.  During a broadcast, mouse and keyboard input to connection windows is ignored; all connections remain in transmit mode, as indicated by the ear icon when the mouse is over a connection window.


Extended status
Viewing extended status

The Help/Extended Status dialogue shows detailed information about the status of Speak Freely.  Once displayed, the dialogue remains on the screen until you press the Close button and is updated in real time as events occur which change the status of Speak Freely.  The status information is grouped into the following categories.

Network

Items in this box specify the number of sound packets sent to connected hosts and received from hosts since Speak Freely was launched.  "Samples per packet" gives the number of original sound samples which can be stored in each 512 byte output packet, based on the compression modes currently selected.  There are 8000 samples of audio per second; compression allows more original samples to fit in each packet.  "Packet size" indicates the maximum size datagram packet your network can transmit; as long as this is more than the WINSOCK requirement of 512 bytes, everything should work fine.  "Sending with:" indicates which socket write function is being used; to work around errors in certain network drivers, it's necessary to support both send() and sendto().  In case of trouble it's handy to know which one we're calling.

Packets lost

This box lets you know how many packets have been lost due to audio hardware or network bandwidth limitations.  If your audio hardware is half-duplex, you won't be able to hear incoming sound while you're transmitting.  The "Input (half-duplex)" field increments every time a received packet is discarded because it arrived while you were transmitting.  Input packets can also be lost if the size of the audio output queue exceeds 3/4 of the size of the message queue obtained from Windows;  see the "Audio" and "Message queue" sections below for additional details.  The "Output (net busy)" field increments every time a packet of sound you're attempting to transmit is discarded because your network connection was too slow to complete sending earlier packets.  This is an indication you need to use a more efficient compression mode.

Audio

The current status, sample size, and sampling rate of the audio hardware are given for both input and output channels.  "Idle" indicates the channel is not in use, "Active" that it's currently sending or receiving.  The Output channel can also have modes of "Terminating", indicating shutdown in progress while Speak Freely is exiting, and "Transition": forced shutdown of output in progress when transmission is requested and the audio hardware is half-duplex.  When output is in progress, a number of output packets can be in the transmission queue at once; the "Queue length" field indicates how many or "Queue empty" if no packets remain to play.  The last line in the dialogue indicates whether the audio hardware is half- or full-duplex.

Connection

The number of active connections (whether temporary or permanent) is given, along with the compression mode currently selected for audio sent to those connections.

Message queue size

Because Speak Freely can be doing many things at once, it needs to increase the size of the queue which receives messages from Windows to more than the default of 8 messages.  When launched, Speak Freely attempts to increase the message queue to the maximum of 120 messages.  The actual size obtained is shown in this field.  The maximum number of packets in the audio output queue (see "Audio" above) is limited to 3/4 of the message queue size.  If this limit is exceeded, the input packet will be discarded and the Input field in the "Packets lost" box incremented.


The Answering Machine

What if somebody calls you with Speak Freely when you're not at the computer?  No problem!  Enable the built-in answering machine, and everything will be saved for replay when you return.

The answering machine is initially disabled.  To activate it, bring up the answering machine dialogue with the Connection/Answering Machine menu item and use the "Browse" button to specify a message file.  This file should usually be kept on your hard disc; if you keep it on a RAM drive, all messages will be lost if you reboot the system or experience a power failure.

After selecting a message file name, check the "Record incoming messages" button and press "Close"; all subsequent messages will be saved in the message file.  You can review the messages at any time by opening the Connection/Answering Machine dialogue.  The Next, Previous, and Replay buttons function in the obvious fashion.  Rewind returns to the start of the recorded messages.  When you're done replaying messages, press "Erase All" to delete all the messages on the answering machine and reclaim the disc space used to store them.


Show your face

Speak Freely's Show Your Face mechanism lets people see who they're talking to.  If you'd like to show people who connect an image of your face (or any other image, for that matter), create a 256 colour uncompressed Microsoft Windows Device-Independent Bitmap (.BMP) file containing the image.  The image should not be larger than 128x128 pixels; otherwise it will take a long time to transfer and may interfere with the quality of audio while it's being sent.  Use the Options/Show Your Face... dialogue to specify the bitmap file as "My face image file".  The "Clear" button cancels a previously selected image file.  If the "Show faces of other users" box is checked in this dialogue, face images will be retrieved, where available, and shown in the connection window.

When a face image is displayed in a connection window, transmission to the window is indicated by an arrow ("==>") before the site name in the window title.

If you have trouble getting your face to appear on others' machines, the most likely cause is that you've made the image file as one of the many incompatible variants of .BMP format such as:

OS/2 instead of Windows

Monochrome, 16 colour, or 24-bit colour instead of 256 colour

RLE compressed instead of uncompressed

Make sure the image conforms to the format given above, and it should be transmitted with no difficulty.  The rigid requirements on bitmap file format are imposed in order to make it easier for other, non-Windows systems, to display them.


Publishing your directory entry

Speak Freely's "Look Who's Listening" facility allows you (at your sole discretion) to publish a directory entry on a server so other people on the Internet can see you're on line and willing to accept calls.  If your Internet connection is via a dial-up line (SLIP or PPP connection) which assigns you as different Internet (IP) address and/or host name each time you connect, Look Who's Listening allows people to find your address and contact you any time you're dialed in.

If you'd like to publish your contact information on a Look Who's Listening server, use the Phonebook/Edit Listing... menu item to display the dialogue box shown above.  Set the "Server" field to the host name or Internet address of the Unix site that is running the server.  An experimental server is running at the site lwl.fourmilab.ch, but is not guaranteed to remain in service permanently.  The information in your directory entry will be visible only to users who query the same server on which you've published it.  This allows private networks to set up an in-house Look Who's Listening server that is not accessible to everybody on the Internet.

Enter the information you wish to publish in the various "User identification" fields.  The E-mail address is required; all the other fields may be left blank.  Think carefully before publishing your telephone number and location; you are potentially disclosing this information to every user on the Internet.  If you include a telephone number, please remember to include your international dialing country code and area code.  The country code for Canada and the United States is 1.

Your E-mail address is the primary means by which others contact you; enter the address you usually give to individuals who wish to contact you or include, for example, on your business card.  It needn't have anything to do with the host and network on which you're running Speak Freely .  For example, if you usually give out your E-mail address at work, you might specify jetson@sprockets.com even though you connect to the Internet at home as george@slip3986.terra.ssol.net.

The information you supply will be sent to the named server only if the "List in directory" box is checked.  (This option will allow you, in a future release of Speak Freely, to share the information in your directory entry with people you connect to while not publishing it publicly on a server.)

Normally, the server returns all active sites which contain the query string in either the E-mail address or full name fields.  If you check the "Exact match only" box, only queries which exactly match your E-mail address will return your contact information.  Further, checking "Exact match only" excludes your entry from the World-Wide Web document published by the server listing all currently active sites.  This allows dial-up users to permit those knowing their E-mail address to contact them while not informing any curious Internet user that they're on line.  The security-conscious should note that this protection is provided by the Look Who's Listening server, and assumes the site you contact is running an unmodified version of the server program which is operating as intended.


Finding on-line users

Speak Freely's "Look Who's Listening" facility allows Speak Freely users to publish their E-mail and Internet addresses and optional additional information on a server accessible to other users.  You can query a Look Who's Listening Server with the Phonebook/Search... menu item.

The "Server" specifies the host name or Internet address of a Unix site running the server you wish to query.  An experimental server is running at the site lwl.fourmilab.ch, but is not guaranteed to remain in service permanently.  If you've published your directory on a server, the same server is used as the default for searches.

When you first connect to a server, the text box at the bottom left will show the server's welcome message, if any.  This message usually identifies the server and indicates the location on the World-Wide Web where it publishes a list of all active Speak Freely users who have published directory entries there.

To look for an on-line user, enter the user's E-mail address in the "User" box and press "Search".  If the user did not check "Exact match only" in the Phonebook/Edit Listing... dialogue and you did not check "Exact match only" in this dialogue box, all entries that contain the characters you entered in the "User" box within the E-mail address or Full name fields are returned, up to a limit of 5 to 10 depending on the length of the entries.  The server is intended to find individual users, not provide a "wild card" list of a large number of active sites; consult the World-Wide Web document indicated by the server in its welcome message if you'd like to see a list of all active sites.


Why compression?
Compression modes

If you're talking to another user on the same high-speed local area network, or you're one of the lucky few with a high bandwidth connection to the Internet backbone, there's no need to bother compressing audio.  The data rate of 8000 bytes per second is modest compared to other Internet applications such as file transfer and accessing graphics-intensive pages on the World-Wide Web.

The rest of us, faced with a bottleneck of anywhere from 14,400 to 65,536 bits per second between our machine and the rest of the world, have to find a way to squeeze 8000 bytes per second into a communications channel with a capacity between 1440 and 6500 bytes per second.  Speak Freely provides four forms of compression, each with different trade-offs among efficiency of compression, loss of fidelity in the compression process, and the amount of computation required to compress and decompress.

Compression options

Compression is selected by checking one or more of the compression items on the Options menu.  The chosen compression mode(s) apply to all sound transmitted to open connections: sound files as well as live audio.  Compression modes cannot be changed while you're transmitting live audio; click the mouse in each transmitting connection window to pause transmission, change the compression mode, then click or double click to resume transmission.

If no compression is selected, Speak Freely requires your network to reliably transmit 8000 characters per second.  If it's slower than that, the person you're talking to will hear pauses in the sound they receive and sound will be lost.  Most local area networks, unless extremely heavily loaded, have no difficulty transmitting data at this rate--in fact, most are capable of speeds on the order of a million characters per second.  It's when you leave your local network and venture into the worldwide Internet that compression becomes crucial.  Very few Internet users today have connections faster than 64 kilobits per second, and many are using dial-up modem lines at 14.4 or 28.8 kilobits per second.

For asynchronous serial communication, the data rate in bytes per second is about one tenth the speed in bits per second so it's clear that even a 64 Kb line can't transmit uncompressed sound at 8000 bytes per second.  Speak Freely provides three forms of compression which can be selected independently or in combination to reduce the data rate.

"Simple compression" discards every other sample and thereby halves the data rate to 4000 bytes per second, within the capability of a 64 Kb connection.  On the receiving end, the elided samples are synthesised by averaging adjacent samples.  Simple compression requires very little CPU time but it substantially degrades sound quality--high frequency components are lost and weird sampling aliasing can occur.  Still, voice is generally intelligible and it's certainly better than random pauses and lost sound.

"GSM" compression (the default mode) employs the algorithm GSM (Global System Mobile) telephones use to reduce the data rate by a factor of almost five with little degradation of voice-grade audio.  Enabling this option reduces the data rate from 8000 bytes per second to 1650 bytes per second, which renders a connection by 28.8 Kb modem usable.  The catch is that GSM encoding is a very complicated process and, if your computer isn't fast enough, it won't be able to keep up with the audio coming in. (Decoding requires only about half the computation as encoding.)  To use GSM compression, you'll need a fast 486, Pentium, or later generation processor.  Thus, a slower network connection increases the demand on your computer.

"ADPCM" compression uses Adaptive Differential Pulse Code Modulation to halve the data rate to 4000 bytes per second.  The compression is identical to that accomplished by Simple compression, but the loss in fidelity is much less; for voice grade audio, it's barely perceptible.  ADPCM encoding and decoding requires more computation than Simple compression but enormously less than GSM; if your computer is too slow for GSM and the compression achieved by ADPCM is adequate for your network link, it's the best choice.

You can combine Simple and either GSM or ADPCM compression.  The CPU requirement is only slightly greater than for GSM or ADPCM compression alone and the sound quality is about the same as for Simple compression.  Simple and GSM compression combined yield a data rate of 800 bytes per second, which a 14.4 Kb network link can handle.  Simple and ADPCM compression together yield a data rate of 2000 bytes per second, within the capability of a 28.8 Kb link.

"LPC" compression uses Linear Predictive Coding to reduce the data rate by more than a factor of 12.  This achieves the greatest degree of compression of any of the available options but, like GSM, it is extremely computationally intense.  LPC requires many calculations to be done in floating point; if your machine does not have a math coprocessor, it will almost certainly be unable to do LPC compression and decompression in real time.  LPC compression is extremely sensitive to high frequency noise and clipping caused by setting the audio input level too high.  If you hear frequent bursts of loud static, try reducing the gain on the microphone or speaking further away from it.  Also, try to avoid the pops that result from talking directly into the mike; they also create bursts of noise.  Finally, users with high pitched voices may not be able to use LPC compression at all: it just loses too much high-frequency information.  If GSM is a cellular phone, think of LPC as a shortwave radio.  It doesn't always work, you have to be careful to get the best results, and even in the best of circumstances there will be some noise and distortion.  But, like shortwave, it lets you communicate (or at least try) when nothing else will work.  If your network link is so slow that none of the other forms of compression are usable, give it a try.

Only one of the compression modes GSM, ADPCM, and LPC may be selected at once.  Choosing any of them turns off a previously-selected mode.

Here's a summary of the various compression options available to you:

	Bytes per	Kilobits per	Need fast	Sound
Compression	second	second	CPU?	fidelity
No compression	8000	80000	No	Best
Simple	4000	40000	No	Poor
ADPCM	4000	40000	No	Good
Simple + ADPCM	2000	20000	No	Lousy
GSM	1650	16500	Yes	Good
Simple + GSM	825	8250	Yes	Lousy
LPC	650	6500	Yes	Depends


Why encryption?

Why bother with encryption?  Privacy!  When you talk over a data network, anybody connected to your network or with access to any of the links your sound data passes through on its way to a distant Internet site can potentially eavesdrop on your conversation.  Encryption, based on a key known only to you and person you're talking to, protects against interception by third parties.  No encryption scheme can be absolutely guaranteed to be 100% secure and even if it were, you'd still be at risk if somebody gained access to your key.  But the encryption offered by Speak Freely, particularly the IDEA algorithm which is also used by PGP to encrypt message bodies, provides a great deal of security, indeed better than any generally available digital cellular telephone.

When the problems with Windows serial port support are resolved, you'll be able to make dial-up modem connections with Speak Freely and use it as a scrambler to protect your conventional telephone calls.


PGP key exchange

If PGP is installed on your computer, Speak Freely will cooperate with it to provide the convenience of public key encryption.  To encrypt sound to one or more users on your PGP public keyring, enter enough of their user name(s) to uniquely identify them in the "PGP user name(s)" field of the Option/Connections dialogue.  When you click OK to close the dialogue, Speak Freely generates a 128 bit random session key for subsequent communications, invokes PGP in an MS-DOS window to encrypt it with the public key(s) of the named user(s), and transmits it to the host or multicast group the connection addresses.  Sound packets sent subsequently to that connection are IDEA encrypted (the same algorithm PGP uses for message bodies) using the session key.  The ability to encrypt a session key with more than one user's public key allows you to transmit securely to multiple subscribers to a multicast.

When a session key is received from a remote host, PGP is invoked to decrypt it using your secret key.  If you haven't specified your secret key pass phrase using the PGPPASS environment variable, you'll have to type the pass phrase in the MS-DOS window in which PGP is running.  See the discussion of the security risks created by the undeniably convenient PGPPASS variable in Phil Zimmerman's " The Official PGP User's Guide" cited in the bookshelf.

Speak Freely invokes PGP via the SFPGP.PIF file in Speak Freely's release directory.  If you'd like to change the modes used for running PGP (for example, to use full-screen mode instead of an MS-DOS window), edit this file with the PIF editor and select the modes you prefer.  If no SFPGP.PIF file is found, Speak Freely attempts to run PGP directly, using whatever default modes you've set for MS-DOS programs launched by Windows applications.

The IDEA encryption algorithm used to encrypt audio following a PGP key exchange is patented and may not be used commercially without a license; see "Patent issues" for further details.

PGP key exchange and its subsequent IDEA encryption are independent of, and can be used in conjunction with, the other secret key encryption options provided by Speak Freely.  There's little to be gained in security and everything to be lost in convenience by combining secret and public key encryption, but if you want to for some reason, you can.


DES encryption

If a DES key is specified in the Option/Connections dialogue, it will be is used to encrypt sound transmitted to that host using a slightly modified version of the Data Encryption Standard algorithm (the initial and final permutations, which do not contribute to the security of the algorithm and exist purely to deter software implementations of DES are not performed).  In order to decrypt sound encoded with DES, the connection on the receiving machine must specify an identical DES key.  The DES key phrase can be as long as 255 characters.  The actual DES key is created by applying the MD5 algorithm to the given key phrase, then folding the resulting 128 bit digest into 56 bits with XOR and AND.

Speak Freely will continue to correctly receive unencrypted sound from a given host even if a DES key is specified for the connection.


IDEA encryption

If an IDEA key is specified in the Option/Connections dialogue, it will be is used to encrypt sound transmitted to that host with the International Data Encryption Algorithm (IDEA).  In order to decrypt sound encoded with IDEA, the connection on the receiving machine specify an identical IDEA key.  The IDEA key phrase can be as long as 255 characters.  The actual IDEA key is created by applying the MD5 algorithm to the given key phrase to create the 128 bit IDEA key.

IDEA encryption is substantially faster and generally considered to be much more secure than DES encryption.  However, IDEA is newer, has not been formally adopted by governments, and is patented, restricting its commercial use.  If your CPU is fast enough, you can enable any combination of IDEA, DES, and key file encryption.  But since PGP uses IDEA to transmit message bodies, if you rely on  PGP to exchange keys with other parties, the fundamental security of your voice link rests upon IDEA alone.

Cipher block chaining is used within each sound packet, but not from packet to packet.  If that were done, loss of a single packet would render the entire rest of the conversation unintelligible.

Speak Freely will continue to correctly receive unencrypted sound  from a given host even if an IDEA key is specified for the connection.

The IDEA encryption algorithm is patented and may not be used commercially without a license; see "Patent issues" for further details.


Key file encryption

A key file is a binary file containing essentially random data as long as the individual sound packets being sent.  Enter the full path name of the file in the "Key file" box of the Options/Connection dialogue box or use the "Browse" button to pop up a file open dialogue to select the file.

The file you specify as a key file should be at least 512 bytes long and consist of near-random (in the sense of incompressible) data.  The "+makerandom=length filename" option of PGP is an excellent way to generate such a file.  To securely deliver a copy of the key file to the person you wish to talk to, encrypt it with their public key using PGP and send it to them, in ASCII armoured form, via electronic mail.

Key file encryption is by far the least demanding on your computer; it requires almost no additional computation.  The level of security provided, however, is much less than the other encryption options, and should be viewed as a last resort alternative to transmitting in the clear if your machine is too slow to use any other form of encryption.

Speak Freely will continue to correctly receive unencrypted sound from a given host even if a key file is specified for the connection.


Key generation, management, and exchange

Unlike PGP, Speak Freely is a conventional secret key cryptographic system.  Why?  Because the RSA public key cryptosystem is the subject of U.S. Patent 4,405,929 and I have no desire to thread through the legal maze that PGP had to run in order to become both legal and freely available.  Rather than replicating the public key functionality of PGP, Speak Freely cooperates with a copy of PGP installed on your machine, delegating the public key encryption of a session key to PGP.  If you have PGP installed on your machine, please turn to the section on PGP key exchange.  Users without access to PGP or who, for some reason or another, can't execute PGP from within Speak Freely can use the following technique to generate and exchange session keys.

First of all, make up a key.  You could pick a long nonsense phrase like,

The fribbits seem glinky today, don't you think?

or some gibberish pounding on the keyboard.  (But watch out!  That's often a lot less random that you might think.  That's how the Russians used to make one-time pads for spies.  The alternation of left and right hand keystrokes on mechanical typewriters was clearly evident from captured pads.)

But why go to the trouble when Speak Freely will make up a key for you on the spot?  The Options/Create Key menu item generates a seed number from the time, date, and a variety of information about your computer and uses it to initialise a highly-secure IDEA-based random number generator.  (Commercial users: read the "Patent issues" section before using this feature.)  The key is displayed in a dialogue box:

Each time you press the "New Key" button, another key is generated, containing 128 bits of information, the same as an IDEA key and more than twice the 56 bits of a DES key.  The text of the key is automatically selected and may be copied to the clipboard with Ctrl+C and pasted into a key field in the Options/Connection dialogue box and an electronic mail message to the person you want to speak with.  The message might read something like:

Hi!  I'd like to talk to you around 21:00 your time tonight with Speak Freely.  I've generated a key of:

NHCG-AJHP-ILJN-DHAI-NFEI-CPKO-PINJ-JIAA

for this conversation.  Please paste this key into the IDEA encryption box when you set up the connection to my machine.  I'm looking forward to chatting with you!

Encrypt the message with whatever tool you use to protect your electronic mail, and send it winging its way over the Internet.

When your friend receives the message and decrypts it, she will know the key to use for your forthcoming conversation.  You can either generate a new random key for each conversation (as PGP does) or, if you trust the other person (and yourself!) to keep the key secret, use it for multiple conversations with that individual.

If you use a public key cryptosystem, this technique permits you to exchange keys for conversations with people you've never previously communicated with in any manner, as long as you trust their published public keys to actually be theirs.  Of course when you let Speak Freely generate the key, you're trusting me to not have installed a "back door" that allows me to know what key you'll get, or to have accidentally introduced a bug which makes the keys predictable.


Encryption legal issues

Certain governments attempt to restrict the availability, use, and exportation of software with cryptographic capabilities.  Speak Freely was developed in Switzerland, which has no such restrictions.  The DES, MD5, and IDEA packages it uses were obtained from an Internet site in another European country which has no restrictions on cryptographic software.  If you import this software into a country which restricts cryptographic software, be sure to comply with whatever laws and regulations apply.  The obligation to obey the law in your jurisdiction is entirely your own.

The IDEA encryption algorithm is patented and may not be used commercially without a license; see "Patent issues" for further details.


Encryption patent issues

The IDEA[tm] block cipher is patented by Ascom-Tech AG. The Swiss patent number is PCT/CH91/00117, the European patent number is EP 0 482 154 B1, and the U.S. patent number is US005214703.  IDEA[tm] is a trademark of Ascom-Tech AG.  There is no license fee required for noncommercial use.  Commercial users may obtain licensing details from Dr. Dieter Profos, Ascom-Tech AG, Solothurn Lab, Postfach 151, CH-4502 Solothurn, Switzerland, Tel +41 65 242 885, Fax +41 65 235 761.

You can use IDEA encryption for noncommercial communications without a license from Ascom-Tech; commercial use is prohibited without a license.  If you don't want to obtain a license from Ascom-Tech, use DES or key file encryption instead.


Command line arguments

If you'd like Speak Freely to start with one or more connections already open, save the connections in .SFX files, and create a program item (Windows 3.x) or shortcut (Windows 95) which names the saved connections on the Speak Freely command line (target in Windows 95).  Be sure to specify a complete path name for each connection file.  If you'd like Speak Freely to start minimised rather than as an open window, add the "/S" switch to the command line or choose that mode when editing the properties of the program item/shortcut.

The following command line, which assumes you've installed Speak Freely in the directory C:\SPEAKFRE, starts the program minimised with two connections already open.

c:\speakfre\speakfre.exe /s c:\speakfre\alice.sfx c:\speakfre\bob.sfx


Problems: regular pauses in output

If you hear regular pauses in output you receive, or the person you're talking to reports the same in audio you send, the most likely causes are:

1.	Your network connection isn't fast enough to send real-time audio with the compression modes you've chosen.  Try additional compression to reduce the volume of data you're sending.

2.	The compression mode you've selected (almost always GSM) requires more computation than your computer or the computer of the person you're talking to) can perform in real time.  Choose a less efficient but faster form of compression.

3.	You've chosen encryption mode(s) which require more computation than your computer can do in real time.  Use fewer or less computationally intense modes of encryption.  DES is the slowest form of encryption, IDEA (also used by PGP key exchange) is intermediate in speed.  Key file encryption requires virtually no computation.  If you've selected multiple encryption modes, the computation required is the sum of each of the individual modes.


Problems: random pauses in output

Random pauses in output, for example when you've received sound for several minutes from a given connection, then lose three or four seconds of sound, or just random brief interruptions in the sound you hear are most probably due to:

1.	The network you're communicating over, whether a local network in your office or the global Internet, is busy and sound packets are being delayed by other traffic.  Unlike a file transfer which can proceed at any speed, intelligible audio requires not only adequate bandwidth (data rate) but consistent delivery time.  The latter condition breaks down as a network approaches saturation.  The only solution (other than connecting to a faster network) is to reschedule your conversation for a time when the network is less heavily loaded.

2.	Other tasks running in the background on your computer or that of your interlocutor may be stealing CPU cycles that Speak Freely needs in order to compress/decompress or encrypt/decrypt sound in real time.  Terminate the background tasks.


Problems: modem connections don't work

So, you've decided to give dial-up modem connections a try despite all my warnings not to.  And you've discovered it works about as well as swallowing Doctor Kelvin's Anti-Gravity Pill before entering a locally Lorentzian frame as your barrel hurtles over the edge of Reichenbach Falls.  I told y-o--u--u---u----u...splash!

Doesn't work, does it?  Frustrating, isn't it?  Very Microsoft, somehow.

You see, most PCs have serial ports which require a received character to be removed from the input assembly buffer before the next character is completely received.  Under DOS, this isn't difficult since the program in charge can glom the entire CPU, but Windows is an operating system (I think the phrase on the French edition, "Système d' Exploitation" is more evocative), and hence imposes a serious overhead or interrupt latency on every urgent request from the system's hardware, including the serial port.  In other words, when a character arrives from the modem, Windows has to drop whatever it's doing, grab the character and save it in memory, all before the following character shows up.  This is no problem at slow speeds, since characters only arrive every several milliseconds, but at 28,800 bits per second, there's a new character every 350 microseconds, and eventually Windows can't make it to the serial port in time and something gets lost.  This is disastrous when transmitting compressed and/or encrypted speech where any dropped character can render the rest of the sound buffer unintelligible.

The solution to this problem is more intelligent serial port hardware and driver software.  The 16550A chip, with its 16 byte FIFO buffer, improves the situation dramatically, but only if you have a driver that takes advantage of this feature. Best of all would be a DMA serial port which required no intervention by the CPU while transmitting or receiving a buffer.

With the rapid growth of the Internet and increased demand for high speed dial-up access via modem, it's likely the PC serial port situation will improve in the near future.  Patience.


Problems: compression slows down connection

You've encountered regular pauses when sending or receiving sound and, to cope with the problem, enabled GSM compression to reduce the data rate.  But the problem got worse-- more audio was lost with compression than without!  What's going on?

This indicates that not only isn't your network connection fast enough to transmit audio in real time, your computer can't compress it into something your network can send quickly enough to keep up with the audio input.

Short of replacing your computer with a faster machine which can perform GSM compression in real-time or obtaining a faster connection to the Internet, the only options are to try ADPCM compression or to see if enabling both Simple and GSM compression with the Options/Connection menu item works.  By discarding every other sample, Simple compression halves the amount of data the GSM algorithm must process in a given time period.


Viewing hardware configuration

The configuration of machine's audio input/output hardware is shown in the Help/About Speak Freely dialogue.  The sample rate, bits per sample, and active/idle status are given for both input and output channels.  If your machine's sound hardware can't send at the same time it's receiving (half-duplex), a line so indicating will appear.

More detailed information about configuration and the real time status of Speak Freely is available in the Help/Extended Status dialogue.


Sampling: 8 vs. 16 bits
Sampling: 8 vs. 16 bit

For the best sound quality, 16 bit sampling is desirable.  Speak Freely translates 16 bit Pulse Code Modulation (PCM) samples into an 8 bit logarithmic encoding known as mu-law, which effectively squeezes 13 bits of audio information into each 8 bit byte.  If your sound hardware supports 16 bit samples, that mode is automatically chosen.  If, for some reason, you want to run in 8 bit mode (which sounds worse and doesn't run any faster) you can do so by checking the Options/Use 8-bit Audio menu item.

If your hardware supports only 8 bit samples, this menu item is automatically checked and disabled, since you don't have the option of choosing 16 bits.


Half-duplex vs. full-duplex audio
Half-duplex vs. full-duplex

On a regular telephone, you can talk and listen at the same time: the telephone is a full-duplex device.  With a portable radio walkie-talkie, on the other hand, as long as you hold down the "Talk" button, you can't hear anybody else who's trying to talk to you--that's why radio users say "Over" at the end of a transmission--so the other person knows you've finished and they can talk now.  The walkie-talkie is half-duplex: it can communicate in both directions but only one way at a time.  (A radio broadcast station is simplex: you can't respond to its transmissions at all, except by calling the DJ on the phone.)

Audio hardware on the Sun and Silicon Graphics machines which run Speak Freely for Unix is full-duplex but, unfortunately, many inexpensive sound boards installed in Windows machines are half-duplex, intended for "recording" and "playing" like a tape recorder instead of real-time conversation.

Speak Freely copes with half-duplex audio hardware in the following manner.  When launched, it immediately attempts to open both audio input and output simultaneously, input first.  If the output open fails, but then succeeds on a second try after input has been closed, the hardware is marked half-duplex.  You can see whether Speak Freely detected your hardware to be half- or full-duplex by displaying the Help/About Speak Freely or Help/Extended Status dialogue boxes.

If a half-duplex card is installed, pressing the mouse button to send live audio immediately mutes any sound you're receiving and discards any that arrives while you're talking.  When you release the mouse button, output of sound from other hosts resumes.  You can send sound files to hosts even while they're transmitting to you but, of course, if their own hardware is half-duplex they won't hear it.

If your hardware is half-duplex, use the double click feature with great care.  If you accidentally leave a connection in constant transmission, output will remain muted and nobody will be able to speak to you.  If an input-output conflict has caused your audio hardware to be treated as half-duplex, an indication to that effect appears in the Help/About Speak Freely dialogue box.

Since they all have full-duplex audio, some Unix workstation users of Speak Freely for Unix transmit continuously.  If you're talking to somebody who does this, consider asking them to indicate, perhaps by saying "Over", when they're done speaking and expect a response from you and, ideally, use the push-to-talk mode provided in Speak Freely for Unix when communicating with you.


Bugs, features, and frequently-asked questions

I have a high-bandwidth connection to the Internet.  Why do I get pauses and lost sound?

Unlike file transfers, transmitting intelligible audio requires not only adequate bandwidth but consistent delivery time.  If one packet of sound takes a tenth of a second to arrive, the next two seconds, and the third half a second, not only will be there an audible pause but they'll be received and played out of order.

Network congestion and moment-to-moment re-routing can cause precisely this kind of inconsistent delivery time.  If you're using a public network, there's nothing you can do other than try again later when there may be less traffic.  Remember, the Internet was never intended to transmit real-time data such as audio; it's a miracle it works as well as it does.

My machine hangs as soon as I try to transmit.

This is usually the result of failing to set a compression mode appropriate for the speed of your Internet connection.  What should happen in this case is that sound that can't be sent in time is just discarded, but some implementations of WINSOCK seem to hang the machine when a program tries to send data faster than the network can accept it.  In many cases (assuming you have a fast enough computer), setting Options/GSM Compression will cure the problem.

I tried to call you and nobody answered.

Thousands and thousands of people have downloaded Speak Freely, and the first thing a depressingly large percentage of them do is immediately try to call me to "see if it works".  If I allowed all these calls to interrupt me, development on Speak Freely (and everything else) would immediately cease.  So while I occasionally accept calls, until and unless people become more considerate of my time, I mute the speaker whenever I'm doing serious work.  Find somebody else to test with, perhaps somebody who has published their address on a Look Who's Listening server.

Is there / when will there be a Macintosh version?

As soon as somebody makes one.  I have neither the knowledge nor the hardware to port Speak Freely to the Macintosh myself, but it would be a relatively straightforward project for a Mac developer experienced in both network and audio programming, I believe.  The compression and encryption code should be usable with little or no modification.  The bulk of the work would be in the user interface, network driver, and audio input/output which, due to great differences between Windows and the Macintosh, would have to be essentially rewritten.  If you're interested in making a Mac version of Speak Freely, please let me know by E-mail (kelvin@fourmilab.ch) so I can let you know if anybody else has already undertaken the task.

I don't get it.  I've installed Speak Freely and it runs OK, but nothing happens when I connect to the IRC server.  What gives?

Speak Freely is a telephone, not a party-line chat program like IRC.  You run a copy on your machine, the other person runs a copy on theirs, and then you talk to one another person-to-person--there's no server in the loop nor any need for one.  Somebody could certainly make a voice chat program, but this isn't it.  If your network supports multicasting, you can use that facility to organise conference groups individuals can join and leave at will.  The Phonebook/Search... menu item permits you to access a Look Who's Listening server to locate other people running Speak Freely.

Can Speak Freely talk to other network voice program?

No.  Because the progenitor of Speak Freely dates back to 1991, when sending voice over data networks was rather exotic, it uses its own rough-and-ready network protocol which (as far as I know) isn't compatible with any other program.  A future release of Speak Freely will support the draft Internet Real-Time Protocol (RTP), the emerging standard for voice and video transmission over the Internet, and will be then able to intercommunicate with any other RTP-compliant software.

How can I make sure Speak Freely is always running on my machine?

Put a copy of the Speak Freely icon in your StartUp program group (or whatever it's called if you're running a non-English edition of Windows).  You'll probably want to check the "Run Minimized" box so it starts as an icon.  If you check the Look Who's Talking menu item, the Speak Freely window will automatically pop open whenever a remote machine makes a connection to yours.  If you'd like to automatically establish one or more ready-to-use connections, specify the names of the connection files describing them on the command line, separated by spaces.

Help!  I'm trapped behind a firewall and can't talk to people at other Internet sites.  What can I do?

Little or nothing, unfortunately.  Speak Freely communicates using Internet UDP protocol on non-privileged ports 2074 through 2076.  Most firewalls block all non-privileged (and hence unknown) port number packets, since there's no way to know they aren't being used by a mole or a Trojan Horse application to transmit sensitive data to a remote site.  Speak Freely uses a nonprivileged port precisely to avoid the need for involving your system administrator in installing the program, but if you're behind a firewall you have no alternative.  If you can persuade your jovial sysadmin to allow UDP packets on ports 2074 through 2076 to pass both directions through the firewall, you'll be all set, but the odds of this are extremely slim--I certainly wouldn't permit it were I your site manager.  Once there's a known port out of your system, any program, not just Speak Freely, can transmit anything it likes accessible on your system to any other host on the Internet; if you permit that, why have a firewall in the first place?  Basically, you'll just have to wait until the demand for network voice conferencing becomes strong enough at your site that your administrator installs a secure proxy tool to create a bridge across the firewall that Speak Freely can cross.  By the time that happens, Speak Freely will support the proposed Internet Real-Time Protocol (RTP), so a proxy server for that protocol will allow Speak Freely, along with other RTP conferencing tools, to communicate across the firewall.  In the short term, there's nothing you or I can do to get across the firewall.

Aren't you going to wreck the Internet by clogging it with all this sound traffic?

This is a legitimate concern in regard to video conferencing programs, but not with a voice-only tool like Speak Freely.  With GSM compression, real-time audio requires a bandwidth of just 1650 bytes per second.  This is far less than a typical FTP session, and people regularly make multi-megabyte FTP archives available without fear of clogging the Internet.  A user accessing one of the many graphics-rich World-Wide Web sites can easily consume more Internet bandwidth than Speak Freely.  In addition, the load created by real-time audio is inherently self-limiting.  As a network link approaches saturation, the consistency of packet delivery time becomes dramatically worse, while non-real-time applications such as FTP and Web transfers simply begin to smoothly slow down.  Long before the links between two sites reach their bandwidth limit, the audio users will have given up in frustration with break-ups and lost sound, to try again, perhaps, when the network is less busy.

Why do face images go all weird when more than one person is connected at once?

This occurs when your system has a 256 colour display board, and each face has its own set of 256 colours.  The active connection will be displayed with the correct colours but other connections must use a default colour table.  If you upgrade your display adaptor to full-colour, multiple face images will display correctly.

How secure is the encryption?

I've used the best algorithms I know of and applied them in the best ways I could given the constraints of real-time audio, fallible communication networks, and the computing power of contemporary personal computers.  But I'm not a professional cryptographer or cryptanalyst and even if I were, you shouldn't believe something is secure just because the author claims it to be.  One of the reasons I'm releasing complete source code for Speak Freely is to permit independent evaluation of the implementation and application of encryption within the program by experts in the community.  With time, a consensus will emerge as to the degree of security Speak Freely provides and how to remedy any perceived weaknesses in future releases.  Key file encryption is very insecure, but I already warned you about that; it's intended purely as a last-ditch alternative for users with computers too slow to run any of the other forms of encryption, yet who prefer any protection, however weak, to transmitting entirely in the clear.

Why do you use datagram protocol with no end-to-end acknowledgment that would permit detecting and correcting errors?

Network transmission delays rule out end-to-end acknowledgment.  Audio has to be delivered in real time to be intelligible.  Waiting for an ack from the other end would, in many cases, require delaying up to a second before sending the next packet.  The best we can do is blindly spray packets at the other end in the hope enough will arrive with sufficiently consistent delivery time to be intelligible.  Over slow links to distant sites, several packets will be flowing through the network toward the destination at a given time.  Providing connections with guaranteed bandwidth and consistent delivery time is one of the main challenges in extending the Internet to accommodate real time audio and video communication.

I run the Windows debug kernel and I get whatever messages when I do...

I've sweated blood to try to make this thing debug kernel clean, and as of this writing I don't know of any remaining warts except those related to the ugly demise of modem connections, which don't work well enough to effectively debug.  With half-duplex audio hardware, attempting to open input while output is open causes several "GlobalReAlloc failed" and "LocalAlloc failed" messages from the Kernel, which it presumably handles correctly since no apparent harm is done.  But, as a battle-weary Windows warrior, I have no illusions that I've "found the last one".  If you see warnings or errors unrelated to modem connections or half-duplex output to input transitions, please let me know by E-mail (kelvin@fourmilab.ch) and provide as much information as you can about precisely what you were doing, what message(s) you got, whether you could reproduce the problem, and which sound card, network interface, and network (WINSOCK) software you're using.  Thanks in advance.


Workarounds for driver bugs

One of the special joys of working with Windows is the never-ending challenge of discovering and working around ratty bugs in crummy drivers.  With Windows late to arrive with a resounding thud in the worlds of networking and multimedia, Speak Freely finds itself close to the frontier, as it were, where frequent raids by marauding bands of byte bandits are the price one pays for the privilege of pioneering.  The defensive programmer finds himself transcending that time-proven style of software development and becoming truly paranoid, always looking over his shoulder for the next incoming arrow of misfortune.  This is, after all, a system on which functions such as GetTextMetrics() can return an error status.

The Options/Workarounds menu tree allows you to select workarounds for various errors in audio and network drivers.  In an ideal world none of these would be needed, but in an ideal world Windows wouldn't exist.  All workaround settings are remembered from session to session.  Workarounds can be selected only when no connections are active, and some workarounds take effect only when Speak Freely is restarted; a message box will appear to let you know if this is the case.

Available workarounds are described in the following paragraphs, along with suggestions as to when enabling them may be necessary.

Audio

Assume Half-duplex

Assumes the sound card is half-duplex without requiring it to fail an output open while input is open.  Accommodates cards which are actually half-duplex but don't indicate so by failing when one attempts to open input and output simultaneously.  Also handles cards which crash the system or application when you try to open them in full-duplex mode.

Assume 11025 Samples/sec

Assumes the card is capable only of 11025 samples per second mode, not our preferred 8000 samples per second.  Permits correct operation on cards which don't fail when opened with a sample rate of 8000 samples per second but which can't actually run at that rate.

Network

Always Bind Socket

When a network socket is created for transmitting sound, there's no reason to bind it to an address, but some network drivers are reputed to fail if a socket isn't bound.  Checking this menu item binds transmit sockets to persuade such feeble minded networks to let us use them.

Never Connect Outbound Socket

Don't connect() the output sockets.  This implies we'll always use sendto() to write to those sockets.  Clears "Use send(), Not sendto()" mode if set.  Some WINSOCK implementations, notably Microsoft's own in Windows NT and Windows 95, blatantly diverge from the Berkeley sockets practice of treating connect() on a datagram socket as merely specifying a default address, not prohibiting subsequent use of sendto() with an explicit address.  Checking this item disables the call on connect() entirely, just in case there's some driver which becomes entirely befuddled if it is used.

Use send(), Not sendto()

Always use send() to write to outbound sockets; don't wait for a sendto() to fail first.  Accommodates drivers where a sendto() on a connected socket crashes the application or system.  Clears "Never Connect Outbound Socket" mode if set.  We normally auto-detect the failure of sendto() on a connected socket and fall back to send().  This item allows entirely bypassing the sendto() just in case it wreaks havoc when used on a connected socket.

Multicast TTL Argument Is char

The arguments for the multicast setsockopt() calls IP_MULTICAST_TTL and IP_MULTICAST_LOOP are documented as type "char" in every Unix Socket implementation I've seen.  The Windows Socket 1.1 specification does not contain these calls, as multicast was not a part of WINSOCK at the time.  Microsoft's application note on multicast support in Windows NT (and now Windows 95) shows the argument for these two calls as "int" and, sure enough, if you pass a char the call errors with WSAEFAULT (bad address).  Speak Freely conforms to the Microsoft specification and passes int arguments to these two calls but, just in case there's a more Unix-like WINSOCK out there which requires a char argument, provides you this workaround to use char instead.  Even though we're running on a little-endian machine, since the length of the argument is passed in the setsockopt() call, the two cases are distinguishable.


Speak Freely for Unix

Speak Freely for Unix is currently available for Sun Microsystems and Silicon Graphics workstations.  It allows network communications compatible with Speak Freely for Windows.  The Unix version lacks the graphical user interface of the Windows edition, but supports all its compression and encryption modes.

The current version of Speak Freely for Unix is always posted in the directory:

ftp://ftp.fourmilab.ch/pub/kelvin/speakfree/unix

Documentation for the Unix version is included in the archive available from the above directory, and on the World-Wide Web as:

http://www.fourmilab.ch/speakfree/unix/


Credits

Like most free software, Speak Freely exists in large part because I was able to stand on the shoulders of other authors of generally available software.  The following software components, either incorporated into Speak Freely or providing a model for how to develop similar software, tremendously reduced the blood, sweat, toil, and tears, not to mention man-months required to complete this software.  Any restrictions on the use and distribution of these software components are noted below.

The GSM compression and decompression code was developed by Jutta Degener (jutta@cs.tu-berlin.de) and Carsten Bormann (cabo@cs.tu-berlin.de) of the Communications and Operating Systems Research Group, Technische Universität  Berlin: Fax: +49.30.31425156, Phone: +49.30.31424315.  They note that THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.  Please see the README and COPYRITE files in the gsm directory of the source code distribution for further details.

The ADPCM compression and decompression code was developed by Jack Jansen of the Centre for Mathematics and Computer Science, Amsterdam, The Netherlands. Please see the README and COPYRITE files in the adpcm directory for further details.

The DES encryption code was developed by Phil Karn, KA9Q.  Please see the README file in the des directory of the source code distribution for further details.

The IDEA algorithm was developed by Xuejia Lai and James L. Massey, of ETH Zürich.  The implementation used in Speak Freely was modified and derived from original C code developed by Xuejia Lai and optimized for speed by Colin Plumb <colin@nsq.gts.org>. The IDEA encryption algorithm is patented and may not be used commercially without a license; see "Patent issues" for further details.

The MD5 message-digest algorithm implementation is based on a public domain version written by Colin Plumb in 1993. The algorithm is due to Ron Rivest.

The experimental Linear Predictive Coding (LPC) compression code was developed by Ron Frederick of Xerox PARC.


Bookshelf

The following references will help you understand the design, implementation, and use of Speak Freely.

Allard, J., Keith Moore, and David Treadwell. Plug into Serious Network Programming with the Windows Sockets API.  Microsoft Systems Journal, Vol 8, No 7, 35, (July 1993).  Excellent introduction to the Windows Sockets (WINSOCK) API used by Speak Freely for network communications.  The WORMHOLE sample application presented in this article provided the model for Speak Freely, in particular suggesting that the Multiple Document Interface (MDI) was an excellent way to represent multiple simultaneous connections.

Davis, Ralph.  Windows Network Programming.  Reading (Mass.): Addison-Wesley, 1993.  Documents the programming interface of a variety of networks, including a network-independent interface module for each.  The chapter covering the Windows Sockets (WINSOCK) API is one of the clearest expositions of that facility I've encountered.

Denning, Dorothy E.  Cryptography and Data Security.  Reading (Mass.): Addison-Wesley, 1987.  Thorough technical reference on the design and application of various methods.  Includes an analysis of the strengths and weaknesses of DES.

Microsoft.  Microsoft Windows Multimedia Programmer's Reference.  Redmond, Washington: Microsoft Press, 1991.  Documents the Windows Multimedia API, including the waveInxxx and waveOutxxx functions used to receive and send audio, and the mmioXxx functions used to read .WAV files.  This book is useful only if you want to modify the source code of Speak Freely.

Schneier, Bruce. The IDEA Encryption Algorithm.  Dr. Dobb's Journal, 208, 50, (December 1993).  Detailed information on the design, cryptographic security, and implementation of IDEA, used by both PGP and Speak Freely.  The source code included in this article was adapted to implement Speak Freely 's IDEA encryption.

Zimmerman, Philip R.  The Official PGP User's Guide.  Cambridge (Mass.): MIT Press, 1995.  Written by the creator of PGP, this book provides practical information on how to obtain, install, and use PGP to securely exchange information (including Speak Freely keys) even with strangers, and discusses the strengths and weaknesses of the DES and IDEA cryptographic algorithms and the legal issues associated with secure communication between individuals.


Development Log

23 August 1995

Initial announcement of Speak Freely Release 5.0.

24 August 1995

Peter Claus Gutman (pgut01@cs.auckland.az.nz), developer of a very nice encryption library, wrote to suggest his library might prove useful.  In the source code for the library, I found a clever 80x86 assembly-language implementation of IDEA, made freely available by its author, who is identified in the source code only as "Bryan".  Whoever you are, Bryan, great piece of work!  If you, or somebody who knows who you are, happens to read this, let me know so I can give complete attribution.

I integrated the assembly language loop into IDEA\IDEA.C, modifying it slightly to work with Microsoft Visual C's inline assembler, so you don't need a separate assembler to take advantage of the optimised code.  Whether the assembler or original C code is used depends upon whether USE_ASM is defined, so you can use the original loop for reference or if, for example, your compiler doesn't support inline assembly code or is incompatible with the way Microsoft do it.

Enabling the assembly language code increased the speed of IDEA encryption and decryption on my 486/50 machine from 152,000 bytes per second to 242,000 bytes per second--well worth the trouble of integrating the code.

30 August 1995

Completed a massive revision to avoid all packet fragmentation and thus work with WINSOCK drivers such as Trumpet WINSOCK.  The changes were so great and ubiquitous there's no point in trying to describe them.  In debugging the changes, one of the mysteries that has been dogging me was finally solved--the random hangs, loss of synchronism, failure to release resources, etc. etc. etc. were the result of Windows discarding messages to the main window as a result of overflows of the default 8 message queue.  Speak Freely juggles a lot of balls in the air at once, and it's very easy to hit this limit.  At initialisation time, we now try to expand the queue to its maximum size of 120 messages or whatever lower maximum the system we're running on supports.

Added the "Extended Status" (Propeller Head) dialogue.

Made compression modes global rather than per-connection.  This means compression only has to be done once, which speeds up party line transmissions.  The change is necessary in any case so that packet size can be optimised.

1 September 1995

Update release 5.1.

8 September 1995

CreateSocket() in UTILITY.C contained a "defensive bind()" to address zero as a work-around for some defective WINSOCK implementations.  Unfortunately, this work-around causes other

that built into Windows NT to fail.  I made the nugatory bind conditional on a new Options/Workarounds/Always Bind Socket menu item which is, of course, saved in the .INI file.

Update release 5.1a.

9 September 1995

Discovered that the reason the socket write was failing on Windows NT and Windows 95 is that Microsoft's built-in WINSOCK, entirely incompatible with Unix and every other WINSOCK I have encountered, refuses sendto() once a datagram socket has been connect()ed.  The sole function of connect() on a datagram socket is to specify a default address so subsequent writes can be done with send() (or, on Unix, write()), and there is no prohibition of overriding this default address with a subsequent sendto().  The WINSOCK specification nowhere mentions such a restriction as a Windows-specific change.  I modified the socket write code in CONNECT.C and the loop-back socket write in FRAME.C to first try sendto().  If it fails, send() is then tried and if that works all subsequent socket writes for the rest of the session are done using send().  This code has been verified to work on both Windows NT and Windows 95 (first customer shipment edition).  Special thanks to John Deters (jad@DHDSC.MN.ORG) who both identified the source of this problem on Windows NT and tested innumerable versions slowly converging toward the actual fix.

Added an item to the Propeller Head dialogue to indicate whether sendto() or send() is being used to write to outbound sockets; it's "Sending with" in the "Network" box.

Tested with the WINSOCK implementation included with Sun PC-NFS 5.1.  Works fine.

Update release 5.1b.

10 September 1995

After last week's experience I decided to indulge in some preemptive workarounds for crummy network and sound card drivers which fail in obvious ways which haven't bitten me yet.  I expanded the Options/Workarounds menu to include:

Audio

Assume Half-duplex

Assumes the sound card is half-duplex without requiring it to fail an output open while input is open.  Accommodates cards which are actually half-duplex but don't indicate this by failing a simultaneous input and output open.  Also handles cards which crash the system or application when you try to open them in full-duplex mode.

Assume 11025 Samples/sec

Assumes the card is capable only of 11025 samples per second mode, not our preferred 8000 samples per second.  Permits correct operation on cards which don't fail when opened with a sample rate of 8000 samples per second but which can't actually run at that rate.

Network

Always Bind Socket

As before; bind outbound sockets, even though there's no need to do so.

Never Connect Outbound Socket

Don't connect() the output sockets.  This implies we'll always use sendto() to write to those sockets.  Clears "Use send(), Not sendto()" mode if set.

Use send(), Not sendto()

Always use send() to write to outbound sockets; don't wait for a sendto() to fail first.  Accommodates drivers where a sendto() on a connected socket crashes the application or system.  Clears "Never Connect Outbound Socket" mode if set.

Multicast TTL Argument Is char

Certain Winsock implementations by a soi-disant "setter of standards" headquartered east of Seattle, Washington in the United States flagrantly ignore the long-established convention that Boolean arguments to multicast setsockopt() calls are of type int.  Their code errors such requests with a "bad address" fault, and accept them only if the argument is passed as a character (incompatible with Unix).  This workaround is set if we empirically discover this to be the case on the system on which we're running, and can be set by the user to preempt dastardly behaviour by systems that don't have the courtesy to inform us of their incompatibilities with contemporary community standards.

All the workaround modes are saved in the SPEAKFRE.INI file and apply to subsequent executions.  The menu items are disabled when a connection is active.

As suggested by John Deters (jad@DHDSC.MN.ORG), I added the ability to automatically open an iconised version of Speak Freely whenever a new inbound connection is established.  This lets you see the site that's just started talking to you.  Since some people might find such an unsolicited pop-up irritating, this only happens if you check the new Options menu item "Look Who's Talking".

Tested under Windows 95 final build.  Works fine when using the standard built-in WINSOCK, but doesn't resolve host names when Sun PC-NFS is overloaded on top of Windows networking.  This appears to be a general problem of this configuration; other programs fail on gethostbyname() in precisely the same way.  When you configure Windows 95, be sure to install the TCP/IP driver; if you don't you'll get nowhere fast.

12 September 1995

Sending a stereo .WAV file in ADPCM compression mode crashed the Unix speaker program.  The code in READWAVE.C which calculates the number of bytes of .WAV file needed to fill a packet was incorrectly assuming the nBlockAlign field was the size of an individual sample, not the frame of samples for all channels.  Fixed.

Closing a connection while a .WAV file was being sent orphaned the MMIO handle used to read the file.  Fixed in CONNECT.C.

13 September 1995

Added the ability to drop saved connection (.SFX) files in the MDI frame window and thereby open (or activate, if already open) connections to the hosts given in the files.  You can drop multiple connection files in a multiple selection and each will be opened.

CONNECT.C had its own implementation of DragAcceptFiles() which directly twiddled WS_EX_ACCEPTFILES.  It doesn't any more.

If a connection file is named on the command line when the program is launched, it is opened once the application is initialised.  This permits making an association between the .SFX extension and Speak Freely in the File Manager and launching the program for a given connection by double clicking the connection file.  You can specify multiple connection files on the command line, space separated.  This allows making a program item icon which opens a collection of connections, a handy thing to put in your StartUp folder.  (Suggested by John Gilmore (gnu@toad.com)).

John also pointed out that the program wasn't usable without a mouse since the left mouse button was the only way to push to talk.  I added logic in CONNECT.C that permits the space bar to be used to toggle push to talk, just as in the Unix mike program.  You can cycle between open connections with Ctrl+Tab and use the space bar to select any set to which you wish to transmit.

Mouseless users who push to talk with the space bar don't have the

benefit of the cursor change to indicate which connections are transmitting.  I added a "Transmitting" status indicator in the connection window which appears whenever live audio is being sent to the window.

If you make a .WAV sound file with the (nonstandard) sampling rate of 8000 samples per second, it is now played correctly by READWAVE.C, not forced to the closest standard sampling rate of 11025 samples per second.  Conversion of stereo .WAV files into mono is still performed for 8000 sample per second files.  If the user has the ability to make 8000 sample/sec .WAVs, this reduces file size, improves sound quality, and eliminates CPU overhead when sending such files.  .AU files remain the fastest, since they're already mu-law encoded.

14 September 1995

Update release 5.1c.

20 September 1995

Began work on answering machine.  Defined structure for data in file, added a new ANSWER.C module with a function to save a sound buffer in an answer file in that format.

25 September 1995

Modified the new connection dialogue handler to allow numeric IP addresses which can't be resolved into host names.  If the host name lookup fails, the dotted IP number from inet_ntoa is used as the host name.

Good ole' Trumpet Winsock returns an error status if gethostname() is called with a buffer too small to hold the entire name, as opposed to truncating it as Unix does.  I changed the two calls in CONNECT.C to get the host name in a temporary buffer, then copy as much as will fit into the sendinghost field of the sound buffer.

Added the ability to set the multicast scope with a new item in the Options/Connection dialogue.  This item is enabled only if the IP address is a valid multicast group number.

Bad ole' Windows 95 WINSOCK returns a WSAEFAULT error if you pass a single byte argument for the IP_MULTICAST_TTL setsockopt() call.  This is incompatible with all Unix documentation I have seen.  Trumpet works correctly with the single byte argument, and accepts the 2 byte short required by Windows 95.  Given the likelihood there's some other WINSOCK that requires a one byte argument, in goes another Options/Workaround/Network item: "Multicast TTL Argument Is char" which does it the Unix way, not as required by Windows 95.

26 September 1995

Added a new Connection/Multicast Groups dialogue which allows adding and dropping membership in multicast groups.  Groups can be specified by DNS-resolvable name or by IP address.  A check box controls multicast loop-back of locally sent packets to groups in which this host has added membership.  The loopback box is disabled on systems (such as Windows 95) which do not implement the IP_MULTICAST_LOOP setsockopt() option.

1 October 1995

Discovered the multicast tear-down code in the WM_DESTROY message handler of FRAME.C wasn't testing for a NULL multiName[], resulting in bad GlobalFree() calls when we failed to initialise a multicast port.  Fixed.

FRAME.C wasn't killing the main timeout timer at WM_DESTROY.  Fixed.

If the attempt to drop a multicast membership at WM_DESTROY time failed, a message box was displayed as a child window of the one frame being destroyed.  This is apparently (yet another of the billions and billgatesillions) undocumented no-no--in any case, if you do it, you get an "err USER: Attempt to activate destroyed window" at the time the WM_DESTROY returns.  I changed the parent of the message box in this case to be NULL and it seems to be happy now.  (In FRAME.C).

Finished implementation of the answering machine, ANSWER.C.  I'll probably be back before long to make it more message-oriented (select message from a list box of sites and times, individually delete messages, etc.) but at least it now has basic functionality.

2 October 1995

Added keyboard accelerator (CTRL+T) for answering machine, and a new connection menu item that lets you toggle whether incoming messages are recorded without having to pop up the answering machine dialogue.  Fixed a bug in which checking or unchecking the record incoming messages box in the answering machine dialogue didn't take effect until you closed the dialogue; now it takes effect immediately.

Added code to overwrite the 16 byte session key exchanged via PGP before closing the file on disc.  Unfortunately, since we can't transmit and receive the with a pipe, as we do on Unix, there's still a window while PGP is running during which the session key is visible, but at least this keeps it from lying around in unallocated disc space for an indeterminate time.

If no answering machine message file was configured, the answering machine dialogue in ANSWER.C called scanMessageFile anyway.  Unfortunately, that routine didn't test for answerFile being NULL and proceeded to stomp all over memory.  Fixed in ANSWER.C scanMessageFile().

Moved all translatable strings and formats from the .C modules into the string table of the resource file, using the rstring(), rfilter() functions and the Format() macro as intermediaries.  Strings that aren't to be translated,such as fopen() mode strings, formats that contain only a field editing code, etc. continue to appear as strings in the source code.  Banishing these strings to the resource file reclaimed almost 4K of data space, enough to give us some breathing room should it prove necessary to introduce another static full-size sound buffer for some reason.

3 October 1995

The enabling and disabling of buttons in the answering machine was befuddling Windows' dialogue box keyboard accelerator logic.  I added code at the end of a message replay to restore the input focus to the button last pressed or its logical successor if that button has become disabled as a result of the message we just completed.

Keyboard accelerators in the answering machine were less than optimally chosen due to renaming of buttons during its development.  I rationalised them so the most commonly used buttons have the most obvious keyboard shortcuts.

Pressing the Close button in the answering machine gave a debug kernel "err: window destroyed in window callback".  Why, I know not.  It uses the standard code for modeless dialogues right out of Petzold, which identical code works perfectly in the propeller-head modeless dialogue. Changing the DestroyWindow() to a PostMessage of WM_CLOSE to ourself made the message go away.  I changed the propeller-head dialogue in DIALOGS.C to use the same logic.

Several modal dialogues needlessly included the system menu in their title bar.  Eliminated.  (The modal dialogues such as the answering machine and propeller-head continue to display the system menu.)

Installed help buttons in all the dialogues, linked to the topic in the help file which describes the dialogue.

Moved the names of our help file and the base Windows help file into the resource string table.

I removed the "How to use help" menu item, which has fallen out of fashion.

Changed "Help/Search..." to "Help/Search for Help on..." as used in current Microsoft applications.

4 October 1995

Completed moving all section and item titles for the main .INI file and saved connection files to the string table in the resource file.  Whether these should be translated isn't clear: a normal user won't ever examine these files and translating renders them incompatible between different language editions.  But the saving in data segment size by elminiating duplication of the section titles alone justifies the work.

Added two new string constants kS0[1] = "0" and kS1 = "1" to FRAME.C and changed all references to the explicit constants in profile file I/O to use them.  This eliminates redundant string constants in the data space.

Found a few string constants I'd missed somehow in READWAVE.C.  Banished.

Fixed the answering machine to update the host name when a definitive name (one not displayed in parentheses) is seen, replacing any previously displayed name.

Added help butttons to all the file open dialogues, linked to the appropriate topics in the help file.

Added a pleasant default ring file.  I haven't found a suitable (well-recorded and public domain) telephone bell, so I decided to pioneer non-irritating notification of an incoming call with this wind chime derived sound.  The original appeared on the CD-ROM (N° 5) accompanying "News Windows" N° 26 (octobre 1995) as the file WINDBELL.WAV.  I used Silicon Graphics' soundfiler to convert this from an 11025 kHz PCM stereo file to an 8 kHz monaural .AU file for optimal transmission.

Substantial data space was being wasted by repeated constant references to the profile (.INI) file name.  I moved this string to the string table in the resource file and changed the code that loads and saves the global configuration to load it once into a string on the stack and reference that temporary copy in all the [Read|Write]PrivateProfile... calls that follow.

Added a new MAKEBIN.BAT file in the home directory which builds the binary release archive.  Now that the release includes more than the .EXE and .HLP file, something more archival than my fallible memory is needed to make sure

5 October 1995

Remade all screen shots for help file, the addition of the help buttons required updating all the dialogue bitmaps.

Added logic to the invocations of PGP in FRAME.C and DIALOGS.C to first try to use the SFPGP.PIF file from the Speak Freely release directory (obtained with GetModuleFileName) and then, if that fails, fall back to call on PGP counting on path search to find it.  Going through the PIF allows the user to override the default modes for a WinExec call to a DOS program such as PGP, in particular, to run it in a window, which is much less disruptive of the user's equanimity than blasting out to a DOS prompt.

6 October 1995

Feature release 5.3.

30 October 1995

All of the Look Who's Listening functionality is working, at least if you don't push it into reentrancy into Winsock by trying one of the LWL dialogues while sending or receiving sound.  I'll have to go back and review the appropriate locks to keep from befuddling Winsock with actual multitasking.  Essentially all the code is in the new module lwl.c.

7 November 1995

Added support for RTP-compatible LPC compression (the Xerox PARC algorithm developed by Ron Frederick).  This algorithm does a lot of floating point computation (forget it if you don't have a math coprocessor), and it sometimes mangles sound, especially if you drive the audio input into clipping or have a high-pitched voice.  But when it works, it achieves better than 12 to 1 compression, and allows running over 9600 baud lines.  The LPC code is in a new lpc subdirectory.

13 November 1995

Added a first cut "broadcast" facility to permit transmission of material to multiple hosts (over a suitably fast, probably local network) without the need to install multicast.  The facility is relatively crude but should be adequate for uses applications such as broadcasting meetings across a local network.

The site performing the broadcast simply checks Connection/Broadcast.  Any audio which arrives while Broadcast is checked is sent to every connected host.  All input events are ignored in connection windows while a broadcast is in progress, and remotely initiated connections will not time out during a broadcast.  A user can subscribe to a broadcast from a given host by initiating a connection to it and sending a short burst of sound (a second's worth, say).  This opens a connection on the broadcasting host to which the broadcast will be sent.   A remote host can unsubscribe from the broadcast by sending a similar short burst of sound any time after 10 seconds into the broadcast; the site's connection on the broadcasting host will be closed 10 seconds later.  The 10 second delay is to prevent toggling of the broadcast state due to multiple packets being received from the remote site.  Whilst broadcasting, the application title indicates "- Broadcasting" and the cursor is always the ear when over a connection window.  When broadcasting is toggled off, all connection windows are marked as not being transmitted to and remotely-opened connections resume the timeout process.

Using short bursts of sound to subscribe and unsubscribe is ugly but it gets the job done.  Once we have a proper RTP packet exchange delimiting the connection, it can be replaced.

14 November 1995

If somebody is already blasting sound at us when Speak Freely is launched, it got all befuddled due to packets arriving before initialisation was fully complete.  I changed the WM_CREATE logic in FRAME.C to not enable input on the socket until initialisation is entirely done.

16 November 1995

Feature release 5.5

22 November 1995

People seem to get floating divide by zero errors if they try to use LPC compression on Windows 95.  I added a call to _control87() in the initialisation code to disable all floating point error interrupts.  This should allow the LPC code to just bumble along with infinities and NANs like it does on Unix, which doesn't seem to do any harm (my suspicion is that this happens only when the LPC code is fed dead silence).  This will have no effect anywhere else, since floating point is used only in the LPC code.

I made GSM compression the default out of the box.  I'm deeply weary of explaining how to enable GSM compression to hundreds of people a day who can't be bothered to read the help file.

The Phonebook/Search host didn't default to lwl.fourmilab.ch unless you'd previously made a directory listing.  Fixed.

The Phonebook/Search box wasn't quite wide enough to hold the longest line of a typical server message and didn't have a horizontal scroll bar.  This caused perplexed people to send hundreds of E-mails when they couldn't access the truncated URL the LWL server published.  I made the box a few characters wider and enable horizontal scrolling.

There was also some ragged logic in the default server for publishing directory entries.  Fixed to correctly default to lwl.fourmilab.ch.

Update release 5.5a.

28 November 1995

Integrated server-side support for the "show your face" feature.  The new file FACE.C contains a dialogue that allows the user to designate a 256 colour .BMP file (the format is verified) as his or her face image and a function invoked from FRAME.C that delivers blocks of the image as requested by a remote host.  Processing of face image requests occurs before audio output is acquired (but after creating a connection), so half-duplex systems can still transfer face images while sending audio.

30 November 1995

Integrated client-side handler for "show your face".  Face data packets are assembled in FACE.C into an in-memory bitmap in the connection structure.  If a complete bitmap is available, the WM_PAINT handler in CONNECT.C for the connection window displays the bitmap instead of the usual status information.  When a bitmap is displayed in the connection window, transmit state is indicated by preceding the host name with a small ASCII-art arrow.

After adding hundreds of lines of bullshit Windows code trying to swap the palette intelligently when two face images are simultaneously displayed on a colour-mapped display, I decided to exercise that time-proven prerogative of the Windows developer and just give up. The vast majority of users won't connect to more than one person at a time.  I fixed it (with even more bullshit code) so that the active window is always shown with the correct palette and inactive windows with the default palette.  If you this this is easy to fix, baby, just go and try it before you write me some smart-ass E-mail.  Hint: everything you read in the Windows API documentation about palettes is a lie or worse when you start to talk about MDI child windows.  There's a sample application on the Developer CD which claims to do this, but a glance at it leads me to estimate at least a week to integrate and test all the crap they went through trying to do what, on any vaguely competently designed windowing system, should be essentially transparent to the application.  Users of high-colour and true-colour display boards will be blithely unaware of any problem with multiple simultaneous face images.

1 December 1995

Mycal (mycal@monitor.net) reported that messages using simple (2X)

compression were played back at twice normal speed by the answering

machine.  Fixed.

Feature release 5.6.


About the author

John Walker founded Autodesk, Inc. in 1982, was its president through 1986 and chairman until 1988.

Autodesk (ACAD-NASDAQ), one of the five largest personal computer software companies, has become a leader in the computer aided design industry; its first product, AutoCAD, is the de facto worldwide standard for computer aided design and drafting.

John Walker is co-author of AutoCAD and other Autodesk products, including AutoSketch, AutoShade, and Cellular Automata Laboratory.  He is also author of various public domain programs including Home Planet, Moontool; Moontool for Windows; Speak Freely for Unix; CODEGROUP; STEGO; SETTIME; XD; BGET; ATLAST; DICTOOL; PSTAMPR; RANDOM; DIESEL; SMARTALLOC; and the PBMPLUS utilities ppmforge, pgmcrater, sldtoppm, and ppmtoacad.  He has been recognised in Scientific American as having created, in 1975, the first (benign) computer virus.  He was smeared by Wall Street Journal hatchetman G. P. Zachary in a front-page profile on May 28, 1992, and in reply produced and directed the video Reporter At Work, offering unique uncut coverage of a high-stakes boardroom confrontation between an entrepreneur and a reporter sent to ruin him.

Walker's  first book, The Autodesk File, was published in 1989 by New Riders Publishing.  It chronicles Autodesk's growth from $60,000 pooled by a bunch of programmers to a billion dollar company in less than eight years.  The fourth edition of The Autodesk File, updated through the end of 1993, is available on the World-Wide Web at <http://www.fourmilab.ch/autofile/www/autofile.html>.

His second book, The Hacker's Diet: How To Lose Weight and Hair Through Stress and Poor Nutrition is also available on the Web: <http://www.fourmilab.ch/hackdiet/www/hackdiet.html>.

For access to all of Walker's public domain software and writings, visit his home page: <http://www.fourmilab.ch/>.

If his diet book doesn't make the bestseller list and land him a guest shot with Oprah, Walker is entirely prepared to complete his manuscript-in-progress: CatSports---How to Improve Any Game by Replacing the Ball with a Cat.

Fore!

John Walker

kelvin@fourmilab.ch

Neuchâtel, Switzerland

December, 1995

11,411 lines of original code